Skip to content

Set up trusted publishing#69

Open
tkrebes wants to merge 1 commit intomainfrom
tkrebes-patch-1
Open

Set up trusted publishing#69
tkrebes wants to merge 1 commit intomainfrom
tkrebes-patch-1

Conversation

@tkrebes
Copy link
Copy Markdown
Owner

@tkrebes tkrebes commented Sep 24, 2025

What does this Pull Request accomplish?

Set up trusted publishing.

Why should this Pull Request be merged?

Removes the need to manage secrets to publish packages to pypi.org.

What testing has been done?

none

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will need to specify a deployment environment in order to publish to non-test PyPI.

https://dev.azure.com/ni/DevCentral/_wiki/wikis/AppCentral.wiki/138308/How-to-Publish-to-PyPI-From-GitHub (internal link) has instructions on how to set this up.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, some security recommendations:

  • Pin actions to specific commit hashes (or at least release tags), not branches like master.
  • Pin/lock Python packages to specific versions.
  • Split build and publish into separate jobs, using upload-artifact to pass dist/* between them.
  • In Settings >> Actions >> General, set Workflow Permissions to Read repository contents and packages permissions, and only grant permissions: id-token: write to the publish job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants